package org.jypj.dev.controller;

import org.jypj.dev.model.EmergeBook;
import org.jypj.dev.model.NoticeMessage;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by ChenYu on 2017-06-27.
 * 预览的界面
 */
@Controller
@RequestMapping("webView")
public class WebViewController {

    /**
     * @param nm
     * @param request
     * @return
     */
    @RequestMapping("noticeShow")
    public String toMessageShow(NoticeMessage nm, HttpServletRequest request) {
        request.setAttribute("nm", nm);
        return "webApp/message_show";
    }

    /**
     * @param emergeBook
     * @param request
     * @return
     */
    @RequestMapping("emergeShow")
    public String toEmergeShow(EmergeBook emergeBook, HttpServletRequest request) {
        request.setAttribute("em", emergeBook);
        return "webApp/emerge_book_show";
    }

    /**
     * app使用帮助
     * @param contentHtml
     * @param request
     * @return
     */
    @RequestMapping("appHelpShow")
    public String appHelpShow(String contentHtml, HttpServletRequest request) {
        request.setAttribute("content", contentHtml);
        return "webApp/app_help_show";
    }
}
